import requests
from tools.base_64 import encrypt_str

'''
def login_test(username=None, password=None, captchaCode=None):
    password = encrypt_str(password)
    username = 'uinnova|' + username
    login_url = "https://tarsier.uinnova.cn/" + "vmdb-sso/user/oauth/login"
    data = {"loginCode": username, "password": password, "captchaCode": captchaCode}
    requ = requests.post(url=login_url, data=data, verify=False)
    return requ
'''
def get_token():
    password = encrypt_str("Lian5169*")
    username = 'uinnova|' + "zhuqiqi"
    login_url = "https://tarsier.uinnova.cn/" + "vmdb-sso/user/oauth/login"
    data = {"loginCode": username, "password": password, "captchaCode": None}
    requ = requests.post(url=login_url, data=data, verify=False)
    # print(requ.json()['data']['token'])
    return requ.json()['data']['token']

'''
get_token()

login_test('qiaoconghui', 'Tarsier_001')
'''
